package top.aiprogram.user.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import top.aiprogram.user.dao.TeacherMapper;
import top.aiprogram.user.entity.Teacher;


/**
 * Created by xqh on 2017/6/28.
 */
@Service("teacherServiceImpl")
public class TeacherServiceImpl implements TeacherService {

    @Autowired
    private TeacherMapper teacherMapper;

    @Transactional//(noRollbackFor = RuntimeException.class)不受检查的异常，可以不用处理
    public int createTeacher(Teacher teacher) {
    teacherMapper.insertSelective(teacher);
        return 0;
    }
}
